
class Evolution {
	Population population;
	int maxGeneration;
	
	public Evolution (Population population,int maxGeneration){
		this.population=population;
		this.maxGeneration=maxGeneration;
		
	}
	public Individual getBest(){
		return this.population.getBest();
	}
	 public void evolve(){
	 	int count=0;
	 	while (count<maxGeneration&!(getBest().isIdeal())){
	 		population.nextGeneration();
	 			count=count+1;
	 			System.out.println("generation" +count+" "+getBest());
	 	}
	 }
		
		
		
		
		
		
		}
